﻿using Ec.NETCoreFramework.Common.Core;
using System;
using System.Collections.Generic;
using System.Text;

namespace Ec.NETCoreFramework.Common.MSTest
{
    public class AppConfig
    {
        /// <summary>
        /// automapper 需要通过反射读取的程序集,通过|隔开
        /// </summary>
        public string AutoMapperAssembly { get; set; }
        /// <summary>
        /// Aop配置
        /// </summary>
        public AopConfig Aop { get; set; }
        /// <summary>
        /// 消息队列
        /// </summary>
        public RabbitmqOptions Rabbitmq { get; set; }
        /// <summary>
        /// 调度平台配置
        /// </summary>
        public SchedulerOption Scheduler { get; set; }
        /// <summary>
        /// redis 缓存
        /// </summary>
        public RedisCachingOption RedisCaching { get; set; }
        /// <summary>
        /// redis 锁
        /// </summary>
        public RedisCachingOption RedisLock { get; set; }

        /// <summary>
        /// web 配置
        /// </summary>
        public WebOption WebConfig { get; set; }

        /// <summary>
        /// 路由配置
        /// </summary>
        public RouteConfigOption RouteConfig { get; set; }
        /// <summary>
        /// 安全域名
        /// </summary>
        public string[] SafeDomain { get; set; }

        public ConsulOption ConsulConfig { get; set; }
        

        //各个端对应的密钥
        public Dictionary<string,string> AppSecret { get; set; }
        /// <summary>
        /// 请求时签名的密钥
        /// </summary>
        public RequestAppSecret ReqAppSecret { get; set; }
        /// <summary>
        /// 过滤验证
        /// </summary>

        public FilterValidateConfig FilterValidate { get; set; }
    }
    /// <summary>
    /// Aop配置
    /// </summary>
    public class AopConfig
    {
        /// <summary>
        /// 事物
        /// </summary>
        public bool Transaction { get; set; }
    }
    /// <summary>
    /// 调度平台配置
    /// </summary>
    public class SchedulerOption
    {

        /// <summary>
        /// Ec.NETCoreFramework公钥
        /// </summary>
        public string PublicKey { get; set; }
        /// <summary>
        /// Ec.NETCoreFramework私钥
        /// </summary>
        public string PrivateKey { get; set; }
        /// <summary>
        /// 调度平台公钥
        /// </summary>
        public string SchedulerPublicKey { get; set; }
        /// <summary>
        /// 调度平台私钥
        /// </summary>
        public string SchedulerPrivateKey { get; set; }

    }

    /// <summary>
    /// EasyCaching 配置，如果有集群在进行更改
    /// </summary>
    public class RedisCachingOption
    {
        /// <summary>
        /// 主机地址
        /// </summary>
        public string Server { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        public string PassWord { get; set; }
        /// <summary>
        /// 端口号
        /// </summary>
        public int Port { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int DbId { get; set; }
    }
    /// <summary>
    /// 消息队列配置
    /// </summary>
    public class RabbitmqOptions
    {
        /// <summary>
        /// 用户名
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        public string PassWord { get; set; }
        /// <summary>
        /// 服务地址
        /// </summary>
        public string Server { get; set; }
        /// <summary>
        /// 端口号
        /// </summary>
        public int Port { get; set; }
    }
    /// <summary>
    /// EasyCaching 配置，如果有集群在进行更改
    /// </summary>
    public class WebOption
    {
        /// <summary>
        /// 主机地址
        /// </summary>
        public string Domain { get; set; }
        /// <summary>
        /// 等待页面
        /// </summary>
        public string WaitPage { get; set; }
        /// <summary>
        /// 错误页面
        /// </summary>
        public string ErrorPage { get; set; }
        /// <summary>
        /// 授权绑定页面
        /// </summary>
        public string BindPage { get; set; }

    }

    /// <summary>
    /// 路由配置
    /// </summary>
    public class RouteConfigOption
    {
        /// <summary>
        /// 
        /// </summary>
        public string RoutePageOauth { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string RouteAppOauth { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string RouteInstall { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string RouteRegister { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string RouteBusiness { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string RouteData { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string RouteCommand { get; set; }

    }
    public class ConsulOption
    {
        /// <summary>
        /// 主机地址
        /// </summary>
        public string Server { get; set; }
    }
    public class FilterValidateConfig
    {
        /// <summary>
        /// 无需要校验的页面
        /// </summary>
        public string[] FilterRoute { get; set; }
        /// <summary>
        /// 无需要校验的页面
        /// </summary>
        public string[] FilterVersion { get; set; }
    }
}
